<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/layouts/taglib.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>编辑微信用户</title>
    <%@include file="/WEB-INF/layouts/edit-header.jsp"%>
</head>
<body>
    <div class="create-page tpanel">
        <div class="panel-content">
            <div class="container-fluid">

                <form id="createForm" class="form-horizontal">
                    <input type="hidden" name="id" value="${entity.id}" />

                        <div class="form-group form-group-first">
                            <label for="openId" class="col-sm-2 control-label">openId</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control"  
                                    id="openId" name="openId" 
                                    value="${entity.openId}" 
                                            placeholder="请输入openId(必填)" required 
                                    minlength="0" maxlength="100" 
                                            remote="${ctx}/admin/wechat/user/exist?id=${entity.id}&property=openId"
                                    />
                                </div>
                        </div>

                        <div class="form-group">
                            <label for="unionId" class="col-sm-2 control-label">unionId</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control"  
                                    id="unionId" name="unionId" 
                                    value="${entity.unionId}" 
                                            placeholder="请输入unionId(必填)" required 
                                    minlength="0" maxlength="100" 
                                            remote="${ctx}/admin/wechat/user/exist?id=${entity.id}&property=unionId"
                                    />
                                </div>
                        </div>

                        <div class="form-group">
                            <label for="subscribe" class="col-sm-2 control-label">关注状态</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control"  
                                    id="subscribe" name="subscribe" 
                                    value="${entity.subscribe}" 
                                            placeholder="请输入关注状态(必填)" required 
                                    minlength="0" maxlength="50" 
                                    />
                                </div>
                        </div>

                        <div class="form-group">
                            <label for="nickname" class="col-sm-2 control-label">昵称</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control"  
                                    id="nickname" name="nickname" 
                                    value="${entity.nickname}" 
                                            placeholder="请输入昵称(必填)" required 
                                    minlength="0" maxlength="100" 
                                    />
                                </div>
                        </div>

                        <div class="form-group">
                            <label for="gender" class="col-sm-2 control-label">性别</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control"  
                                    id="gender" name="gender" 
                                    value="${entity.gender}" 
                                            placeholder="请输入性别(必填)" required 
                                    minlength="0" maxlength="45" 
                                    />
                                </div>
                        </div>

                        <div class="form-group">
                            <label for="city" class="col-sm-2 control-label">城市</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control"  
                                    id="city" name="city" 
                                    value="${entity.city}" 
                                            placeholder="请输入城市(必填)" required 
                                    minlength="0" maxlength="45" 
                                    />
                                </div>
                        </div>

                        <div class="form-group">
                            <label for="country" class="col-sm-2 control-label">国家</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control"  
                                    id="country" name="country" 
                                    value="${entity.country}" 
                                            placeholder="请输入国家(必填)" required 
                                    minlength="0" maxlength="45" 
                                    />
                                </div>
                        </div>

                        <div class="form-group">
                            <label for="province" class="col-sm-2 control-label">省份</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control"  
                                    id="province" name="province" 
                                    value="${entity.province}" 
                                            placeholder="请输入省份(必填)" required 
                                    minlength="0" maxlength="45" 
                                    />
                                </div>
                        </div>

                        <div class="form-group">
                            <label for="language" class="col-sm-2 control-label">语言</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control"  
                                    id="language" name="language" 
                                    value="${entity.language}" 
                                            placeholder="请输入语言(必填)" required 
                                    minlength="0" maxlength="45" 
                                    />
                                </div>
                        </div>

                        <div class="form-group">
                            <label for="headImgUrl" class="col-sm-2 control-label">头像</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control"  
                                    id="headImgUrl" name="headImgUrl" 
                                    value="${entity.headImgUrl}" 
                                            placeholder="请输入头像(必填)" required 
                                    minlength="0" maxlength="200" 
                                    />
                                </div>
                        </div>

                        <div class="form-group">
                            <label for="subscribeTime" class="col-sm-2 control-label">关注时间</label>
                            <div class="col-sm-8">
                                    <input type="text" class="form-control datetimepicker"    
                                            id="subscribeTime" name="subscribeTime" 
                                            value='<fmt:formatDate value="${entity.subscribeTime}" pattern="yyyy-MM-dd HH:mm:ss" />' 
                                            placeholder="请输入关注时间(必填)" required 
                                            />
                                </div>
                        </div>

                        <div class="form-group">
                            <label for="remark" class="col-sm-2 control-label">备注</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control"  
                                    id="remark" name="remark" 
                                    value="${entity.remark}" 
                                            placeholder="请输入备注(必填)" required 
                                    minlength="0" maxlength="45" 
                                    />
                                </div>
                        </div>

                        <div class="form-group">
                            <label for="groupId" class="col-sm-2 control-label">用户组</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control"  
                                    id="groupId" name="groupId" 
                                    value="${entity.groupId}" 
                                            placeholder="请输入用户组(必填)" required 
                                    minlength="0" maxlength="45" 
                                    />
                                </div>
                        </div>

                        <div class="form-group">
                            <label for="tagidList" class="col-sm-2 control-label">标签</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control"  
                                    id="tagidList" name="tagidList" 
                                    value="${entity.tagidList}" 
                                            placeholder="请输入标签(必填)" required 
                                    minlength="0" maxlength="45" 
                                    />
                                </div>
                        </div>

                    <div class="form-group">
                        <div class="col-sm-12" style="text-align: center;">
                                <a class="btn btn-default" href="javascript:window.history.back();">返回</a>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <input type="submit" class="btn btn-primary" value="保存" />
                        </div>
                    </div>
                </form>

            </div>
        </div>
    </div>
                                                                
    <script type="text/javascript">
    changeTitle('编辑微信用户');
    $(function() {

        initForm('#createForm','${ctx}/admin/wechat/user/update',function(r) {
            var resp = $.parseJSON(r);
            if(resp.code == 'OK') {
                changeUrl('${ctx}/admin/wechat/user');
                topLayer.msg('保存成功', {icon: 1});
            }else {
                topLayer.msg(resp.message, {icon: 2});
            }
        });

    });
    </script>
</body>
</html>
